package com.zidongxiangxi.sharding.job.core.util;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * 休眠工具
 *
 * @author chenxudong
 * @date 2021/02/07
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class BlockUtils {

    /**
     * 等待一小段时间
     */
    public static void waitingShortTime() {
        sleep(100L);
    }

    /**
     * 休眠
     *
     * @param  millis 毫秒数
     */
    public static void sleep(final long millis) {
        try {
            Thread.sleep(millis);
        } catch (final InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    }
}
